import { types, unprotect } from "mobx-state-tree";
import dayjs from "dayjs";

export const Demo = types
  .model("Demo")
  .props({
    name: types.string,
    company: types.string,
    // date:types.string
  })
  .actions((self) => ({
    // 方法
    changeProps(values: any) {
      console.log("修改成功", values);
      (self.name = values.name), (self.company = values.company);
    },
  }));

export const demo = Demo.create({
  name: "努力工作",
  company: "武汉生物城",
});

//解除安全模式   可以不用专门写修改props方法修改props值
unprotect(demo);
